package tests;

import Common.Utils;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

public class AddPage extends Utils {
    public static String url = "http://127.0.0.1:8080/upload.html";

    public AddPage() {
        super(url);
    }
    //上传音乐
    public void Upload() throws InterruptedException {
        WebElement element = driver.findElement(By.cssSelector("body > form > input[type=file]:nth-child(1)"));
        String filePath ="E:\\work\\local\\music\\"+"林俊杰-醉赤壁.mp3";
        element.sendKeys(filePath);
        driver.findElement(By.cssSelector("body > form > label > input[type=text]")).sendKeys("林俊杰");
        driver.findElement(By.cssSelector("body > form > input[type=submit]:nth-child(3)")).click();

    }
}
